package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.MiningRecordMapper;
import com.ruoyi.web.domain.MiningRecord;
import com.ruoyi.web.service.IMiningRecordService;

/**
 * 挖矿记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-30
 */
@Service
public class MiningRecordServiceImpl implements IMiningRecordService 
{
    @Autowired
    private MiningRecordMapper miningRecordMapper;

    /**
     * 查询挖矿记录
     * 
     * @param id 挖矿记录主键
     * @return 挖矿记录
     */
    @Override
    public MiningRecord selectMiningRecordById(Long id)
    {
        return miningRecordMapper.selectMiningRecordById(id);
    }

    /**
     * 查询挖矿记录列表
     * 
     * @param miningRecord 挖矿记录
     * @return 挖矿记录
     */
    @Override
    public List<MiningRecord> selectMiningRecordList(MiningRecord miningRecord)
    {
        return miningRecordMapper.selectMiningRecordList(miningRecord);
    }

    /**
     * 新增挖矿记录
     * 
     * @param miningRecord 挖矿记录
     * @return 结果
     */
    @Override
    public int insertMiningRecord(MiningRecord miningRecord)
    {
        miningRecord.setCreateTime(DateUtils.getNowDate());
        return miningRecordMapper.insertMiningRecord(miningRecord);
    }

    /**
     * 修改挖矿记录
     * 
     * @param miningRecord 挖矿记录
     * @return 结果
     */
    @Override
    public int updateMiningRecord(MiningRecord miningRecord)
    {
        return miningRecordMapper.updateMiningRecord(miningRecord);
    }

    /**
     * 批量删除挖矿记录
     * 
     * @param ids 需要删除的挖矿记录主键
     * @return 结果
     */
    @Override
    public int deleteMiningRecordByIds(Long[] ids)
    {
        return miningRecordMapper.deleteMiningRecordByIds(ids);
    }

    /**
     * 删除挖矿记录信息
     * 
     * @param id 挖矿记录主键
     * @return 结果
     */
    @Override
    public int deleteMiningRecordById(Long id)
    {
        return miningRecordMapper.deleteMiningRecordById(id);
    }
}
